<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>


        let params = {
            page: 1,
            count: 30
        }
        getData('POST', 'https://api.apiopen.top/getImages', params, function(res) {

            console.log(res)

        })


        function getData(method = 'GET', url, params = null, success) {
            var xmlhttp = null;

            if (window.XMLHttpRequest) {
                xmlhttp = new XMLHttpRequest();
            } else if (window.ActiveXObject) {
                xmlhttp = new ActiveXObject("Minrosoft.XMLHTTP")
            }

            if (xmlhttp !== null) {
                xmlhttp.onreadystatechange = function () {
                    if (xmlhttp.readyState === 4) {
                        if (xmlhttp.status === 200) {

                            success && success(xmlhttp.responseText)
                        }
                    }
                }
                xmlhttp.open(method, url, true);
                xmlhttp.send(JSON.stringify(params));
            } else {
                console.log("你的浏览器不只是ajax")
            }
        }
    </script>
</body>

</html>